home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / prg_casm / pcl4c60.zip / SIOERR32.C < prev    next >
Text File  |  1996-10-25  |  1KB  |  42 lines

  1. /*** sioerror.c [32-bit version] ***/
  2.  
  3. #include <stdio.h>
  4. #include "windows.h"
  5. #include "sioerr32.h"
  6.  
  7. static char *ErrorText[24] = {
  8.   /*  0 */    "No error.",
  9.   /* -1 */    "Timeout waiting for I/O.",
  10.   /* -2 */    "Port not enabled.",
  11.   /* -3 */    "No buffer available.",
  12.   /* -4 */    "No such port.",
  13.   /* -5 */    "Expecting 'S', 'C', or 'R' as 2nd argument.",
  14.   /* -6 */    "Expecting 'A', 'C', or 'D' as 2nd argument.",
  15.   /* -7 */    "Bad parity code.",
  16.   /* -8 */    "Bad stop bits code.",
  17.   /* -9 */    "Bad wordlength code.",
  18.  /* -10 */    "Bad buffer size code.",
  19.  /* -11 */    "Bad baud rate code.",
  20.  /* -12 */    "LOOP_BACK test fails.",
  21.  /* -13 */    "UART undefined.",
  22.  /* -14 */    "Bad or missing UART.",
  23.  /* -15 */    "Port already enabled.",
  24.  /* -16 */    "ISR already in use",
  25.  /* -17 */    "No such IRQ",
  26.  /* -18 */    "ISR limit exceeded",
  27.  /* -19 */    "Illegal Modification!",
  28.  /* -20 */    "DPMI Error",
  29.  /* -21 */    "Shareware Version Expired",
  30.  /* -22 */    "Cannot allocate memory",
  31.  /* other */  "No such error code."};
  32.  
  33. void cdecl SioError(int Code)
  34. {int Index;
  35.  if(Code==0) Index = 0;
  36.  else
  37.    {if(Code<-22) Index = 23;
  38.     else Index = 0 - Code;
  39.    }
  40.  printf("\n%s\n",ErrorText[Index]);
  41. } /* end SioError */
  42.